package me.plugin.bukkitlearning.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class MainCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (args.length==0)
        {
            sender.sendMessage("你只输入了/helloworld");
        }
        else if (args.length==1)
        {
            String args_to_string = args[0];
            if (args_to_string.equals("text1"))
            {
                sender.sendMessage("text1");
            }
            else if (args_to_string.equals("text2"))
            {
                sender.sendMessage("text2");
            }
            else
            {
                sender.sendMessage("语法错误");
            }
        }
        else {
            sender.sendMessage("语法错误");

        }
        return false;
    }
}
